﻿using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace WindowsGame1
{
    class Testing : Scene
    {
        NewPlayer Nave;
        Texture2D TiroT;
        Rectangle TiroR;

        SpriteFont fonte3;
        ReachPoint monster;
        public override void Load(ContentManager Content)
        {
            Animation[] animations = new Animation[1];
            animations[0].name = "Standing";
            animations[0].currentFrame = Vector2.Zero;
            animations[0].frameRate = 1000 / 24;
            animations[0].frameSize = new Vector2(39, 43);
            animations[0].totalFrames = new Vector2(0, 3);
            animations[0].startP = new Vector2(39, 0);

            Nave = new NewPlayer(Vector2.Zero, Color.White,
               Content.Load<Texture2D>("ShipSpriteSheet"), animations);
            
            TiroT = Content.Load<Texture2D>("AtackSpriteSheet2");
            TiroR = new Rectangle(4,11 , 4, 11);

            monster = new ReachPoint(new Vector2(450, 250), Color.White, Content.Load<Texture2D>("bloco2"));

        }

        public override void Update(GameTime gameTime)
        {
            Nave.Origem = new Vector2(Nave.Retangulo.Width / 2, Nave.Retangulo.Height / 2);
            Nave.Update(gameTime);

            if (Keyboard.GetState().IsKeyDown(Keys.Space))
                TiroR.X += 5; 
                TiroR.Y+=5;
            
        }
        public override void Draw(SpriteBatch spriteBatch, GameTime gameTime)
        {

            Nave.Draw(spriteBatch);
            //spriteBatch.DrawString(fonte3, "destroy the monster", new Vector2(200f), Color.White);
            spriteBatch.Draw(TiroT, TiroR, Color.White);
            monster.Draw(spriteBatch);
        }

    }
}
